/* Wang Wen(Albert Wang) jawangwen@gmail.com */

#include <stdio.h>
#include <product1.h>
#include <test_main.h>

#define REFER_FUNC_PRODUCT1(func)   REFER_FUNC(func, #func, "product1.c")

/************************** extern tested function **************************/
extern int addRisk (unsigned int riskValue);

extern int subRisk (unsigned int riskValue);

extern void showRisk (void);

/************************** refer static function  **************************/
static int (* getRiskLevel) (void);
static void (* sendMessage) (const char * str);

/************************** stub function  **************************/
static int stub_getRiskLevel (void)
{
    printf("stub_getRiskLevel\n");
    return (int)mock();
}

static void stub_sendMessage (const char * str)
{
    printf("stub_sendMessage: %s\n", str);
    check_expected(str);
}

/************************** test case  **************************/
void refer_product1 (void)
{
    REFER_FUNC_PRODUCT1(getRiskLevel);
    REFER_FUNC_PRODUCT1(sendMessage);
}

void test_addRisk (void ** state)
{
}

void test_subRisk (void ** state)
{
}

void test_getRiskLevel (void ** state)
{
}
/******************************************************************************
*
*  @brief   
*     Test_L1Tra_UPFDpchDataWrite_Success
*  @description
*     Test the L1Tra_UPFDpchDataWrite_Success Success.
*  @checkpoint
*     $return   : txUser.txUser.dataSendingFlag == GLO_TRUE
*     $outMsg   : N/A
*     $faultId  : N/A
*     $outParam : N/A
*     $database : N/A
*
*******************************************************************************/
void test_showRisk (void **state)
{
    SET_STUB(getRiskLevel, stub_getRiskLevel);
    SET_STUB(sendMessage,  stub_sendMessage);

    will_return(stub_getRiskLevel, 0);
    expect_string(stub_sendMessage, str, "No risk");
    showRisk();

    CLEAN_STUB();
}

